package mine.proxy;

import java.lang.reflect.Proxy;

/**
 * Created by james on 16/2/2.
 */
public class DynamicProxyMain {
    public static void main(String[] args) {
        Hello hello = new HelloImpl();

        DynamicProxy dynamicProxy = new DynamicProxy(hello);
        Hello helloProxy = (Hello) Proxy.newProxyInstance(hello.getClass().getClassLoader(),hello.getClass().getInterfaces(),dynamicProxy);
        helloProxy.say("James");
    }
}
